package base.fallback;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName: GateWayFallBack
 * @Description: 网关断路器
 * @Author: CJQ
 * @Date: 2021/2/4 15:43
 */

@RestController
@Slf4j
public class GateWayFallBack {

    /**
     * 网关熔断提示
     *
     * @return
     */
    @RequestMapping("/fallback")
    public Map fallback() {
        log.info("网关熔断降级操作...");
        Map<String, String> map = new HashMap<>();
        map.put("resultCode", "fail");
        map.put("resultMessage", "服务异常");
        map.put("resultObj", "null");
        return map;
    }

}
